package com.ddwl.message.repository.impl;

import com.ddwl.message.model.Advisory;
import com.ddwl.message.repository.AdvisoryRepositoryAdvance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
//import org.springframework.data.mongodb.core.MongoTemplate;
//import org.springframework.data.mongodb.core.query.Criteria;
//import org.springframework.data.mongodb.core.query.Query;

import java.util.List;

/**
 * @author Fu Zhaohui
 * @date 2017/3/26
 */
public class AdvisoryRepositoryImpl /*implements AdvisoryRepositoryAdvance*/ {

//    @Autowired
//    private MongoTemplate template;
//
//    @Override
//    public long countByStatus(Integer status, String empId, String beginDate, String endDate) {
//        Criteria criteria = new Criteria();
//        return template.count(Query.query(criteria), Advisory.class);
//    }
//
//    @Override
//    public List<Advisory> findByStatus(Integer status, String empId, String beginDate, String endDate, int page, int size) {
//        Criteria criteria = new Criteria();
//        Pageable pageable = PageRequest.of(page - 1, size, Sort.Direction.DESC, "gmtCreated");
//        return template.find(Query.query(criteria).with(pageable), Advisory.class);
//    }
}
